import request from '@/utils/request'

/**
 * 
 * @returns 获取项目列表
 */
export function getProjectList(query) {
    return request({
        url: '/business/project/list',
        method: 'get',
        params: query
    })
}
/**
 * 查询所有的项目数据
 * @returns 
 */
export function projectList() {
    return request({
        url: '/business/project/ProjectList',
        method: 'get',
    })
}
/**
 * 添加项目
 * @param {*} data 
 * @returns 
 */
export function addProject(data) {
    return request({
        url: '/business/project/add',
        method: 'post',
        data
    })
}
/**
 * 修改项目
 * @param {*} data 
 * @returns 
 */
export function updateProject(data) {
    return request({
        url: '/business/project/update',
        method: 'post',
        data
    })
}

/**
 * 根据项目id 查询项目的详情
 * @param {*} id 
 * @returns 
 */
export function getProjectDetail(id) {
    return request({
        url: '/business/project/getProject/' + id,
        method: 'get',
    })
}

/**
 * 根据项目id删除项目信息
 * @param {*} id 
 * @returns 
 */
export function delProject(id) {
    return request({
        url: '/business/project/delete/' + id,
        method: 'get',
    })
}

/**
 * 根据项目id 关闭项目
 * @param {*} id 
 * @returns 
 */
export function close(id) {
    return request({
        url: '/business/project/close/' + id,
        method: 'get',
    })
}

/**
 * 根据项目id 取消项目
 * @param {*} id 
 * @returns 
 */
export function cancel(id) {
    return request({
        url: '/business/project/cancel/' + id,
        method: 'get',
    })
}

/**
 * 重新打开已关闭的项目数据
 * @param {*} id 
 * @returns 
 */
export function openCloseProject(id) {
    return request({
        url: '/business/project/open/' + id,
        method: 'get',
    })
}
/**
 * 
 * @returns 获取项目品牌
 */
export function getProjectBrand() {
    return request({
        url: '/business/project/getBrand',
        method: 'get'
    })
}

/**
 * 
 * @returns 获取项目客户
 */
export function getProjectCustom() {
    return request({
        url: '/business/project/getCustom',
        method: 'get'
    })
}



/**
 * 查询项目下bug问题类别数量汇总
 * @param {*} data 
 * @returns 
 */
export function getProjectBugProblemTyp(data) {
    return request({
        url: '/business/project/getProblemTypeCount',
        method: 'get',
        params: data
    })
}

/**
 * 获取专案类别数据统计数据
 * @param {*} data 
 * @returns 
 */
export function getProjectLevelCount(data) {
    return request({
        url: '/business/project/getSpecialCaseCount',
        method: 'get',
    })
}

/**
* 板卡异常Top5
* */
export function getAdBoardTop5() {
    return request({
        url: '/business/project/getAdBoardTop5Count',
        method: 'get',
    })
}

/**
* OC异常Top5
* */
export function getLcmOcTop5() {
    return request({
        url: '/business/project/getLcmOcTop5Count',
        method: 'get',
    })
}

/**
* 电源异常Top5
* */
export function getPowerSupplyTop5() {
    return request({
        url: '/business/project/getPowerSupplyTop5Count',
        method: 'get',
    })
}

/**
* 查询项目专案测试数据统计
* */
export function getProjectLevelTest(data) {
    return request({
        url: '/business/project/getProjectLevelTestCount',
        method: 'get',
        params: data
    })
}
/**
 * 查询项目成熟度数据
 * @param {*} data 
 * @returns 
 */
export function findProjectMaturity(data){
    return request({
        url: '/business/project/projectMaturity',
        method: 'get',
        params: data
    })
}
/**
 * 根据项目id验证项目是否是关闭的
 * @param {*} id 项目id
 * @returns 
 */
export function checkProjectIfClose(id){
    return request({
        url: '/business/project/ifClose/' + id,
        method: 'get',
    })
}






